Management of internal operations by a storage device

ABSTRACT

A method of handling internal operations of a storage device includes in response to information derived from one or more commands received from a host device when the storage device is coupled to the host device, determining whether a sequence of commands is in one of an active state, and a first transition state, where in the first transition state the sequence of commands is transitioning from an inactive state to the active state. The method includes, while the sequence of commands is in the active state or in the first transition state, refraining from executing any operation of a first set of internal memory management operations, each of the first set of internal memory management operations being an extra-sequence operation.

REFERENCE TO EARLIER-FILED APPLICATIONS

This application claims priority from U.S. patent application Ser. No.12/127,229, filed May 27, 2008, which claims the benefit from U.S.Provisional Patent Application No. 60/940,426, filed May 28, 2007. Thecontents of each of these applications is incorporated by referenceherein in their entirety.

FIELD

The present disclosure generally relates to storage devices and morespecifically to a method of autonomous management of internal operationsby a storage device and to a storage device using the method.

BACKGROUND

By “integral sequence of commands” (“INSQs”) is meant herein a recurrentsequence of commands sent to a storage device from a host device, suchas an MP3 player, a digital camera, or a computer system (e.g., alaptop), which sequence or storage device is associated with certainapplications, for example with music playing, video recording, imagescapturing, etc., that have associated with them features, metadata orattributes such as packet size, timestamp, audio or video play backduration, data-read or data-write rate, address access or addresscontinuity, etc. A host device sometimes sends an INSQ to a storagedevice with which it works regardless of which internal operation iscurrently executed by, or is in progress in, the storage device. Thismay detrimentally affect the performance of the storage device and theperformance of the storage-host system as a whole.

The execution of some of the storage device's operations are to beavoided while an INSQ is executed (i.e., while the INSQ is “active”,“On”, or “in progress”), whereas some other storage device's operationsmay be beneficial or mandatory during the execution of the INSQ, asexplained below. A sequence of commands that is not an INSQ is referredto herein as “sporadic sequence of commands”. That is, by “sporadicsequence of commands” is meant commands that are not considered by thestorage device as part of a sequence of commands “known” to the storagedevice, unlike INSQs that are known to the storage device by beingdefined.

A storage device in a computer system can be regarded as rendering astorage service and, therefore, the storage device is expected toprovide a good quality of service (“QoS”) even if it performs backgroundtasks and executes internal operations such as “housekeeping” operationsthat are required for the storage device's normal operation.

Depending on the context of service given by a computer system (e.g.,playing back an audio file, capturing images, copying data file, etc.)an operation executable by the storage device as a “background”operation can belong to a first set of internal operations, which isreferred to hereinafter as an Extra-sequence (“ESQ”) operations group,or to a second set of internal operations, which is referred tohereinafter as an Intra-Sequence (“ISQ”) operations group.

By “ESQ operation” is meant herein a storage operation (e.g., staticwear leveling) that should be avoided if an INSQ is in progress becausethe ESQ operation would have a detrimental effect on, or it wouldinterfere with, or it would otherwise degrade, the performance of thestorage device. For example, it would be beneficial not to executestatic wear leveling operations while a music file is being played backfrom the storage device,

By “ISQ operation” is meant herein a storage, or storage-related,operation that is allowed or permitted to be executed during theexecution of an INSQ because it has a positive contribution on thestorage device's overall operation, or at least it does not interferewith or otherwise negatively affect the execution of the INSQ. In somecases, such an ISQ operation would, if executed, significantly improveinternal efficiency of the storage device itself or the efficiency ofthe involved storage system as a whole. Operations made in preparationfor the next, or for an expected, command (e.g., caching the next data)are exemplary ISQ operations. Sometimes, ISQ operations are even desiredbecause, as far as the Quality of Service (“QoS”) and the overallstorage device's efficiency are concerned, they have a positivecontribution.

In respect of storage devices, ESQ operations may include operationssuch as archiving cached data, static wear leveling, flash folding (alsoknown in the field of flash memory devices as “garbage collection”),ruggedization, and so on, which are known operations in the art ofdigital data storage management. ISQ operations may include: flashmanagement operations; encryption/decryption of outgoing/incoming data;compression/decompression of outgoing/incoming data; anti-virusoperation; defragmentation operation; ruggedization; backing up data;changing data format and so on, which are known operations in the art ofdigital data storage management. Thus, notably, whether a givenoperation is an ISQ or ESQ may depend on the operation (e.g., INSQ) inprogress. The same operation may be an ISQ while one INSQ is occurringand an ESQ while another INSQ is occurring.

In order to improve the performance of storage devices (e.g., in termsof performance, power failure immunity, stable bit rate, etc.),execution of ESQ operations has to be coordinated with the execution ofINSQ in such a way that ESQ operations are not executed while an INSQ isin progress. The reason for this is that executing ESQ operations whilean INSQ is in progress can have an adverse impact on the storagedevice's performance, which may, for example, result in high latency,loss of data, or data corruption. ESQ operations have traditionally beeninitiated by host devices because of the presumption that only a hostdevice can identify when an INSQ terminates and an ESQ operation can,therefore, safely be commenced.

In one prior art solution ESQ operations are allowed to be commenced bya storage device only after the device's host notifies the storagedevice that a current INSQ is terminating, or has terminated, and no newINSQ is scheduled for the time being, or for the next couple of seconds,for example. In other words, even though traditional storage devices arecapable of initiating ESQ operations, they still need confirmation fromtheir host device that they can do so. This constraint requirescooperation of the storage device's designer with the host devicedesigner to allow the storage device's designer to schedule ESQoperations in such a way that they will not collide with an active hostdevice's INSQ.

In another prior art solution ESQ operations are allowed to be initiatedby a storage device autonomously, but they are not synchronized with thehost device; i.e., ESQ operations are sometimes executed by the storagedevice at the wrong timing; i.e., at times when an INSQ is in progressand, therefore, should not be interfered with by ESQs.

It would therefore be beneficial for a storage device to be able toautomatically identify, under the changing context of the servicerendered by the involved storage system, if and when a storagebackground operation can be executed as originally planned or scheduledby the storage device, and if, when and which operations should beprevented, suspended or deferred until a currently executed INSQ isterminated, as well as if, when and which operations may or should beperformed during INSQs execution.

SUMMARY

The following embodiments and aspects thereof are described andillustrated in conjunction with systems, tools, and methods, which aremeant to be exemplary and illustrative but not limiting in scope.

According to the present disclosure a storage device autonomouslydetects, without intervention of a host device, if and when an INSQ isin a certain state (i.e., in “active” state or in “inactive” state) oris changing its state from “active” to “inactive”, or from “inactive” to“active”. Depending on the current state of the INSQ, or on thetransition thereof, the storage device avoids, suspends or refrains fromexecuting ESQ operations or ISQ operations, or allows or permits theseoperations.

A method is provided for handling, by a storage device, internaloperations of the storage device, the method including: (a) defining oneor more INSQs of commands, each of the one or more integral sequences ofcommands being capable of being in an “active” state and in an“inactive” state; (b) associating with each of the one or more integralsequences of commands a first set of internal operations (“ESQ”) and asecond set of internal operations (“ISQ”), the first set of internaloperations being operations that are not to be executed while therespective integral sequence of commands is in the “active” state, andthe second set of internal operations being operations that arepermitted to be executed while the respective integral sequence ofcommands is in the “active” state; (c) receiving a command from a hostdevice; (d) based on information derived from the received command, (andpossibly from previously received commands,) determining whether one ofthe one or more integral sequences of commands is in the “active” state,or is transitioning from the “inactive” state to the “active” state; and(e) if the one of the one or more integral sequences of commands is inthe “active” state, or is transitioning from the “inactive” state to the“active” state the storage device refrains from executing any operationof the first set of internal operations associated with the respectiveintegral sequence of commands.

If the one of the one or more integral sequences of commands is in the“active” state, or is transitioning from the “inactive” state to the“active” state the storage device may permit execution of any operationof the second set of internal operations associated with the respectiveintegral sequence of commands. If, however, the one of the one or moreintegral sequences of commands is in the “inactive” state, or istransitioning from the “active” state to the “inactive” state, thestorage device permits execution of an operation of the first set ofinternal operations and refrains from executing any operation of thesecond set of internal operations associated with the respectiveintegral sequence of commands.

The storage device may determine a transition of the one of the one ormore integral sequences of commands from the “inactive” state to the“active” state, and from the “active” state to the “inactive” state, bydetermining whether the information derived from the command or commandsreceived from the host device satisfy predefined Beginning-Of-Sequence(“BOS”) conditions or End-Of-Sequence (“EOS”) conditions, respectively.The storage device determines whether the information derived from thecommand(s) received from the host device satisfy the predefined BOSconditions or the EOS conditions by comparing values, or accumulatedvalues, of dynamic parameters to predefined static parameters.

At least one of the one or more integral sequences of commands may beassociated with playing back of multimedia content, or with capturingmultimedia content or images, or with data synchronization, or with aboot command.

An operation of the first set, or of the second set, of internaloperations may be a flash management operation; an encryption/decryptionoperation for encrypting/decrypting outgoing/incoming data; acompression/decompression operation for compressing/decompressingoutgoing/incoming data; an anti-virus operation; a ruggedizationoperation; a defragmentation operation; a backing up operation forbacking up data; and an operation involving changing data format. Aflash management operation may be a garbage collection operation; anerror correction operation; caching data operation for caching data intoa fast flash storage area of the storage device; a flushing operationfor flushing cached data; a low power mode operation; and a static wearleveling operation.

A storage device is also provided, which may be a flash memory device.The storage device may include a communication interface for receivingstorage commands from a host device, and a mass storage area for holding(i) one or more predefined integral sequences, each of the one or moreintegral sequences of commands being capable of being in an “active”state and in an “inactive” state and, associated with each of the one ormore integral sequences of commands, (ii) a first set of internaloperations (“ESQ”) and a second set of internal operations (“ISQ”), thefirst set of internal operations being operations that are not to beexecuted while the respective integral sequence of commands is in the“active” state, and the second set of internal operations beingoperations that are permitted to be executed while the respectiveintegral sequence of commands is in the “active” state.

The storage device also includes a controller that is adapted orconfigured (i) to received, via said communication interface, a commandfrom the host device and, based on information derived from the receivedcommand, (and possibly from previously received commands,) (ii) todetermine whether one of the one or more integral sequences of commandsis in the “active” state, or is transitioning from the “inactive” stateto the “active” state, or whether the one of the one or more integralsequences of commands is in the “inactive” state, or is transitioningfrom the “active” state to the “inactive” state.

Responsive to the one of the one or more integral sequences of commandsbeing in the “active” state, or transitioning from the “inactive” stateto the “active” state, the controller refrains from executing anyoperation of the respective first set of internal operations. Inaddition to the controller refraining from executing any operation ofthe respective first set of internal operations the controller maypermit execution of any operation of the second set of internaloperations associated with the respective integral sequence of commands.If the one of the one or more integral sequences is in the “inactive”state, or it is transitioning from the “active” state to the “inactive”state, the controller permits execution of any operation of therespective first set of internal operations.

The controller may determine a transition, or transitioning, of any ofthe one or more integral sequences from “inactive” state to “active”state, and from “active” state to “inactive” state, by assessing ordetermining whether the information derived from the command or commandsreceived from the host device satisfy predefined BOS conditions or EOSconditions, respectively.

In addition to the exemplary aspects and embodiments described above,further aspects and embodiments will become apparent by reference to thefigures and by study of the following detailed description.

BRIEF DESCRIPTION OF THE DRAWINGS

Exemplary embodiments are illustrated in referenced figures. It isintended that the embodiments disclosed herein are illustrative ratherthan restrictive. The disclosure, however, may better be understood withreference to the following detailed description when read with theaccompanying figures, in which:

FIG. 1 shows a state machine that is usable by a storage device todecide a status of an INSQ according to an example embodiment of thepresent disclosure;

FIG. 2 shows steps taken by a storage device when an INSQ transitionsfrom “INSQ not in progress” state to “INSQ in progress” state accordingto the present disclosure;

FIG. 3 shows steps taken by a storage device when an INSQ transitionsfrom “INSQ in progress” state to “INSQ is not in progress” stateaccording to the present disclosure;

FIG. 4 shows an INSQ table for holding static information according toan example embodiment of the present disclosure;

FIG. 5 shows an INSQ table for holding dynamic information according toan example embodiment of the present disclosure;

FIG. 6 shows a method usable by a storage device for changing the stateof an INSQ from “Off” to “On” according to an example embodiment of thepresent disclosure;

FIG. 7 shows a method usable by a storage device for changing the statusof an INSQ from “On” to “Off” according to an example embodiment of thepresent disclosure;

FIG. 8 is a block diagram of a storage device according to an exampleembodiment of the present disclosure;

FIG. 9 shows a database used by a storage device's controller accordingto an example embodiment of the present disclosure; and

FIG. 10 shows a method usable by a storage device according to anexample embodiment of the present disclosure.

It will be appreciated that for simplicity and clarity of illustration,elements shown in the figures are not necessarily drawn to scale.Further, where considered appropriate, reference numerals may berepeated among the figures to indicate like, corresponding or analogouselements.

DETAILED DESCRIPTION

The claims below will be better understood by referring to the presentdetailed description of example embodiments. This description is notintended to limit the scope of claims.

By “Beginning-of-Sequence” (BOS) is meant herein a conclusion reached,or a decision made, by a storage device that an INSQ is commencing oroccurring, or that the INSQ has commenced or has occurred. The storagedevice reaches the conclusion, or makes the decision based on predefinedconditions, without the host device, with which the storage deviceoperates, intervening in the conclusion or decision process, oraffecting it in any way. The storage device evaluates commands issued bythe host device in view of a predefined set of parameters and thresholdvalues (i.e., the conditions) that, if an INSQ is not in progress, cancollectively indicate to the storage device the beginning of the INSQ.

By “End-of-sequence” (EOS) is meant herein a conclusion reached, or adecision made, by a storage device that an INSQ is terminating or hasterminated. The storage device reaches the conclusion, or makes thedecision based on predefined conditions, without the host device, withwhich the storage device operates, intervening in the conclusion ordecision process, or affecting it in any way. The storage deviceevaluates commands issued by the host device in view of a predefined setof parameters and threshold values (i.e., the conditions) that, if anINSQ is in progress, can collectively indicate to the storage device thetermination of the INSQ.

FIG. 1 is a simplified state machine usable by a storage device inaccordance with the present disclosure. According to the presentdisclosure a set of INSQs is predefined and stored in an INSQ table,where each entry in the INSQ table includes an INSQ and parameters thatare associated with that INSQ. Regarding the state machine, each INSQ inthe INSQ table is capable of being in an “active” state, shown as“Integral-sequence in progress” 16, or in an “inactive” state, shown as“Integral-sequence not in progress” 12. One or more INSQs in the INSQtable can simultaneously be active while the other INSQs are inactive.Regarding FIGS. 2 and 3, multiple instances can occur simultaneously fordifferent INSQs.

Given an INSQ in the INSQ table, if the INSQ is currently in the“Integral-sequence not in progress” 12 state and the storage deviceidentifies a Beginning-of-Sequence (BOS) that, as explained above,indicates that the INSQ is now in the active state or it istransitioning from the inactive state to the active state, then thestorage device automatically switches 14 the INSQ's state from“Integral-sequence not in progress” 12 to “Integral-sequence inprogress” 16. If the INSQ is currently in the “Integral-sequence inprogress” 16 state and the storage device identifies an End-of-Sequence(EOS) that, as explained above, indicates that the INSQ now in theinactive state or it is transitioning from the active state to theinactive state, the storage device automatically switches 10 theintegral-sequence's state from “Integral-sequence in progress” 16 to“Integral-sequence not in progress” 12.

FIG. 2 shows steps taken by a storage device when the state of an INSQchanges from “INSQ not in progress” state into “INSQ in progress” stateaccording to the present disclosure. In a storage system that cansimultaneously execute more than one task (such storage system is oftencalled “multi-tasking” or “multi-threading” system), more than one INSQmay be in progress and each INSQ in the INSQ table may undergo the sameor similar evaluation process for evaluating whether the INSQ is inprogress or not.

The following description refers to an exemplary INSQ in the INSQ table(referred to hereinafter as “INSQ 1”), but the same process is relevantto whatever INSQ may be held in the INSQ table. If “INSQ 1” becomesactive the storage device changes, at step 20, the state of the statemachine related to “INSQ 1” from “INSQ 1 not in progress” to “INSQ 1 isin progress”. The storage device determines that “INSQ 1” becomes activeif a BOS is occurring for that INSQ, and BOS is determined as occurringif predefined criteria are satisfied.

As explained above, a background operation executed by a storage devicecan be regarded as an ISQ operation or as an ESQ operation, and ESQoperations should be avoided or stopped while an INSQ is in progress.Therefore at step 22 the storage device suspends ESQ operationspertaining to the active “INSQ 1”, resumes, at step 24, ISQ operationsthat are related to the active INSQ 1, and looks for or waits, at step26, until “INSQ 1” becomes inactive. The storage device determines that“INSQ 1” becomes inactive if an EOS is occurring for that INSQ, and EOSis determined as occurring if predefined criteria are satisfied.Exemplary INSQ tables and criteria for determining when or if an INSQ ischanging, or has changed, its status, are shown in FIGS. 4 and 5, whichare described below.

FIG. 3 shows steps taken by a storage device when the state of an INSQchanges from “INSQ in progress” state to “INSQ not in progress” stateaccording to the present disclosure. The following description alsorefers to the exemplary “INSQ 1” mentioned above, in connection withFIG. 2, but the same evaluation process is relevant to whatever INSQ maybe held in the INSQ table. If “INSQ 1” becomes inactive, an EOS isoccurring, to which the storage device responds by changing, at step 30,the state of the state machine associated with “INSQ 1” from “INSQ 1 inprogress” to “INSQ 1 is not in progress”. As explained above, ESQoperations are allowed by the storage device only if the related INSQ isnot in progress. Therefore, at step 32 the storage device suspends ISQoperations that are related to the inactive “INSQ 1” and at step 34 thestorage device resumes ESQ operations. At step 36 the storage devicelooks for, or waits until, a BOS can be determined.

An INSQ table holds determination criteria that may include two types ofparameters by which a storage device evaluates the status of an INSQ:static parameters, the value of which are not changed during runtime,and dynamic parameters, the value of which are dynamically updated bythe storage device during runtime (i.e., “on-the-fly”) responsive to oneor more commands that the storage device receives or has received fromthe host device, for example responsive to receiving the last commandfrom the host device, and possibly responsive also to one or morecommands that the storage device previously received from the hostdevice. A “static parameter” is effectively a criterion (e.g.,threshold) which the storage device uses to determine if an INSQ is “on”or “off”, or has changed between these two states. A “dynamic parameter”is effectively a value at a given point in time (e.g., upon receipt of agiven command by the storage device) of a variable pertinent to an INSQwhich the storage device checks against the static parameter todetermine if the criterion represented by the static parameter has beensatisfied. For example, if the host device is an MP3 player, the set ofcommands it sends to the storage device may be associated with playing amusic file. A set of commands that are sent by the host device to thestorage device may include one or more commands. Exemplary INSQs andrelated static parameters are shown in FIG. 4 and exemplary dynamicparameters related to the INSQs of FIG. 4 are shown in FIG. 5, both ofwhich figures are described below.

FIG. 4 shows an INSQ table 40 according to an example embodiment of thepresent disclosure. INSQ table 40, which contains INSQs' staticparameters, includes four exemplary entries, numbered 1 through 4, eachof which accommodates one INSQ and INSQ-related parameters andthresholds, as described below. A storage device identifies and updatesthe state of an INSQ (i.e., from “INSQ is in progress” state to “INSQ isnot in progress” state, and vice versa) based on information held inINSQ table 40.

INSQ table 40 includes five exemplary fields for holding the followingexemplary static parameters:

-   -   (1) “INSQ's identifier” (shown at 41). This field may        accommodate the type of each INSQ or the name that has been        assigned to it.    -   (2) “INSQ's BOS parameter” (shown at 42). This field specifies        one or more parameters that have been chosen such that the        storage device can calculate or estimate their value or state,        and the calculated or estimated values or states can indicate        that the related INSQ is already in progress (i.e., it is        already active), or that it is transitioning from the inactive        state to the active state. The one or more parameters, whose        values are derived from one or more commands that the storage        device receives from the host device, allow the storage device        to decide, or to determine, whether a BOS indication has        occurred or is occurring. “Read-performance”, “Time Of Arrival”        (TOA) and command operands (e.g., logical address accessed by        the host device) are exemplary information that the storage        device can collect or calculate from commands received from the        host device.

A Beginning-of-Sequence (BOS) is considered to have occurred when one ormore estimated or calculated parameters meet or exceed a predefinedvalue or satisfy a predefined condition, as is explained in more detailbelow in connection with the “INSQ's BOS Threshold” field.

-   -   (3) “INSQ's BOS threshold” (shown at 43). This field        accommodates a logical condition or a set of logical conditions        that the storage device applies to the one or more parameters        that are specified in INSQ's BOS parameter field 42. If the        logical condition, or the set of logical conditions, associated        with a particular INSQ are satisfied, the storage device        determines that an Integral-sequence BOS has occurred for that        INSQ, after which the storage device changes the status of that        INSQ to “INSQ in progress”. A logical condition may pertain to a        minimum value of a BOS parameter, to a maximum value of a BOS        parameter, to any value between the minimum and maximum values        of a BOS parameter, or to the number of counted events, and so        on.    -   (4) “INSQ's EOS parameter” (shown at 44). This field specifies        one or more parameters that have been chosen such that the        storage device can calculate or estimate their value or state,        and the calculated or estimated values or states can indicate to        the storage device that the related INSQ is about to terminate,        or that it has just terminated. The one or more parameters,        which are derived from commands the storage device receives from        the host device, allow the storage device to decide or to        determine whether an EOS has occurred or is occurring.

“Read-performance”, “Time Of Arrival” (TOA), and command operands (e.g.,logical address accessed by the host device) are exemplary informationthat the storage device can collect or calculate from commands receivedat the storage device from the host device.

A End-of-Sequence (EOS) is considered to be occurring or to haveoccurred when one or more estimated or calculated parameters meet orexceed a predefined value or satisfy a predefined condition, as isexplained in more detail below in connection with the “INSQ's EOSThreshold” field.

-   -   (5) “INSQ's EOS threshold” (shown at 45). This field        accommodates a logical condition or a set of logical conditions        that the storage device applies to the one or more parameters        that are specified in INSQ's EOS parameter field 44. If the        logical condition or the set of logical conditions associated        with a particular INSQ are satisfied, the storage device        determines that an Integral-sequence EOS has occurred for that        INSQ, after which the storage device changes the status of that        INSQ to “INSQ not in progress”. A logical condition may pertain        to a minimum value of an EOS parameter, to a maximum value of an        EOS parameter, to any value between the minimum and maximum        values of an EOS parameter, to the number of counted events, and        so on.

By way of example INSQ table 40 holds four exemplary Integral-sequences(INSQs) that are referred to in “Example 1” through “Example 4”, whichare described below.

EXAMPLE 1 The Host Device Is an MP3 Player

The first entry contains an exemplary INSQ called “Play MP3”, whichpertains to MP3 operations (i.e., the host device is assumed to be anMP3 music player).

An MP3 music player reads media content, which is compressed accordingto the MP3 data format, from a storage device and utilizes adecompression means (whether a software application or a hardwaremodule) to convert (i.e., by decompressing) the compressed media contentinto raw data format that can be used (i.e., played back) by it. The MP3player sends the raw data (i.e., the decompressed media content) to thespeaker (i.e., the MP3 player “plays back” the media content). Becausethe MP3 data format requires that the MP3 file be played back at a ratethat is specified by the MP3 standard, which is currently 16 kilobytesper second (KB/sec), the MP3 player requests data from the storagedevice at the same data rate.

In this example the INSQ's BOS parameter is “Regular average read ratethat matches MP3 standard (16 KB/s)”, shown at 410, which means that thestorage device monitors data-read requests that it receives from the MP3player, and calculates the average rate at which the MP3 player readsthe data to see whether the data-read requests are received at thespecified rate (i.e., 16 KB/s). Under normal data play back operationthe storage device expects that rate to be 16 KB/s, and as long as nodata is read at that rate the storage device “knows” that the Play MP3INSQ has not started yet. As explained above, it is not advisable toperform some internal operations in a storage device while the MP3player is playing back media content. For example, performing wearleveling will severely degrade the quality of the played back audio ifit is done during playback.

In the above-mentioned example the INSQ's BOS decision threshold for the“Regular average read rate that matches MP3 standard (16 KB/s)”parameter may be, for example, “At least 2 seconds of regular datareading”, shown at 415. This means that if data requests are received atthe storage device at the above-mentioned rate (i.e., 16 KB/s) and ifthat rate is maintained for at least 2 seconds, then the storage deviceassumes that a BOS is occurring or has occurred; i.e., this indicates tothe storage device that the “Play MP3” INSQ is commencing or hascommenced, or that the “Play MP3” INSQ is in progress. In such a case(i.e., the “Play MP3” INSQ is in progress), the storage device mayexecute ISQ operations but avoid executing ESQ operations that werepredefined for the “Play MP3” INSQ.

In the above-mentioned example the INSQ's EOS parameter is “Average readrate that does not match MP3 standard (16 KB/s)”, shown at 420, whichmeans that the storage device can calculate the average rate at whichdata read requests are received from an MP3 player, to see whether it isthe specified rate (i.e., 16 KB/s). Under normal data play backoperation the storage device expects that rate to be 16 KB/s, and aslong as data requests continue to be received at the storage device atthat rate the storage device “knows” that the “Play MP3” INSQ is stillin progress.

In the above-mentioned example the INSQ's EOS decision threshold valuefor the “Average read rate that does not match MP3 standard (16 KB/s)”parameter may be, for example, “Not streaming at least 1 second”, shownat 425. This means that if data requests cease to be received at thestorage device at the above-mentioned rate (i.e., 16 KB/s) for at leastone second, this indicates to the storage device that an EOS isoccurring or has occurred; i.e., this indicates to the storage devicethat the “Play MP3” INSQ is terminating or has terminated, or that the“Play MP3” INSQ is no longer in progress. The average read rate willdeviate from the MP3 standard during pauses in playing an MP3 song ordata, or after the entire MP3 file has been played back. In such a case(i.e., the “Play MP3” INSQ is not in progress), the storage deviceallows executing ESQ operations that were predefined for the “Play MP3”INSQ, or resuming execution thereof.

EXAMPLE 2 The Host Device Is a Digital Camera

The second entry contains an exemplary INSQ called “Capture Multi-ShotImage”, which pertains to digital camera operations (i.e., the hostdevice is assumed to be a digital camera). For the sake of the exampleit is assumed that a digital camera captures four images per second(i.e., an image every 250 milliseconds), compresses each image andimmediately sends one compressed image after another to the storagedevice for storage. Assuming that the average size of a compressed imageis 2 megabytes (MB), the camera writes the image data into the storagedevice at a rate of 8 MB per second (MB/sec). In order to evaluate thestatus of the “Capture Multi-Shot Image” INSQ the storage devicemonitors data-write requests that it receives from the digital camera,and calculates the average rate at which the digital camera writes theimages' compressed data into its storage space in order to decidewhether data is written at the expected average rate of 8 MB/sec. Ifdata is written at the expected average rate of 8 MB/sec, or at a higherrate, this means that the “Capture Multi-Shot Image” INSQ has started orit is in progress. Therefore, in this example the INSQ's BOS parameteris “Frequency of bursts writing at over 8 MB/s”. If the “CaptureMulti-Shot Image” INSQ is in progress the storage device may execute ISQoperations but avoid executing ESQ operations that were predefined forthe “Capture Multi-Shot Image” INSQ.

Digital cameras transfer images to the storage device they work with indata bursts, where each data burst represents one image. In this examplethe BOS threshold of the “Capture Multi-Shot Image” INSQ will be kept toa minimum of three data write bursts that arrive one after another witha maximum delay of one millisecond between each two consecutive databursts. If three sequential data bursts are received at the storagedevice (each data burst at a rate of 8 MB/sec) with a maximum delay of 1millisecond, the storage device assumes that the “Capture Multi-ShotImage” INSQ is in progress. Accordingly, the INSQ's BOS threshold is “3bursts separated at less than 1 millisecond”.

If the status of the “Capture Multi-Shot Image” INSQ is “INSQ inprogress”, the storage device waits for an EOS indication because, asexplained above, ESQ operations are allowed to be executed only aftertermination of the INSQ, which, in this example is the “CaptureMulti-Shot Image” INSQ. In order to identify whether an EOS occurs, orhas occurred, the storage device uses the INSQ's EOS threshold “Delay ofover 3 milliseconds between bursts”. In order to identify the EOS of the“Capture Multi-Shot Image” INSQ the storage device monitors data writerequests that are received from the digital camera and checks whetherthe data write requests are provided at an average write rate thatdiffers from 8 MB/sec, or whether there is a delay between twoconsecutive data bursts that exceeds three millisecond, which is theINSQ's EOS threshold in this example. If there is a delay that exceedsthree milliseconds during which no data write requests are received atthe expected rate (i.e., 8 MB/sec) at the storage device, the storagedevice assumes that the “Capture Multi-Shot Image” INSQ is no longer inprogress (i.e., the INSQ has terminated), which means that the storagedevice may allow ESQ operations, which were predefined for the “CaptureMulti-Shot Image” INSQ, to be executed and suspended ESQ operations tobe resumed.

EXAMPLE 3 The Host Device Is a Computer System

The third entry contains an exemplary INSQ called “Update Boot Image”,which pertains to boot operations in a computer system. For the sake ofthe example it is assumed that the computer system updates a data filethat is stored in sequential logical sectors starting from sector #0(zero). If a sector's size is 512 bytes and the data file size is 10kilobytes (KB), the data file is stored in a storage area consisting oftwenty logical sectors (i.e., logical sectors #0 through #19,inclusive). The computer system updates the data file sequentially, byupdating sector #0, then sector #1, and so on, until the last sector(i.e., sector #19) is updated.

In order to evaluate the status of the “Update Boot Image” INSQ thestorage device monitors data-write requests that it receives from thecomputer system. If there is a write request to write data into sector#0, the storage device concludes that the “Update Boot Image” INSQ is inprogress because the INSQ's BOS parameter is, in this example, “Writingto sector #0”, and the INSQ's BOS threshold is “Occurrence of theevent”, which means that data is being, or about to be, written intosector #0. If the “Update Boot Image” INSQ is in progress, the storagedevice may execute ISQ operations but avoid ESQ operations that werepredefined for the “Update Boot Image” INSQ.

When the last logical sector (in this example sector #19) of the datafile is updated the storage device concludes that the “Update BootImage” INSQ is no longer in progress, because the EOS parameter is“Writing to the last sector of the Boot image” and the INSQ's EOSthreshold is “Occurrence of the event”. That is, writing to the lastsector once is sufficient for the storage device to determine that EOShas occurred. If the “Update Boot Image” INSQ is no longer in progress,the storage device may allow ESQ operations to be executed and suspendedEXQ operations to be resumed.

EXAMPLE 4 The Host Device Is a Computer System

The fourth entry contains an exemplary INSQ called “Reading Boot Image”,which pertains to boot operations in a computer system. For the sake ofthe example it is assumed that the computer system reads a data filethat is stored in sequential logical sectors starting from sector #0, asdescribed above in connection with Example 3).

In order to identify the status of the “Reading Boot Image” INSQ, or achange thereof, the storage device monitors data-read requests that itreceives from the computer system. If there is a read request to readdata from sector #0, the storage device concludes that the “Read BootImage” INSQ is in progress, because the BOS parameter is “Reading fromsector #0”, and the BOS threshold is “Occurrence of the event”, whichmeans that data reading from sector #0 is in progress. In such a case(i.e., the “Read Boot Image” INSQ is in progress) the storage device mayexecute ISQ operations but avoid ESQ operations that were predefined forthe “Read Boot Image” INSQ.

When the last logical sector (in this example logical sector #19) of thedata file is finally read the storage device concludes that the “ReadBoot Image” INSQ is no longer in progress, because the EOS parameter is“Reading the last sector of the Boot image” and the EOS threshold is“Occurrence of the event”. That is, reading the last sector issufficient for the storage device to conclude that the “Read Boot Image”INSQ is no longer in progress. In such a case (i.e., the “Read BootImage” INSQ is no longer in progress) the storage device may allow ESQoperations to be executed and suspended EXQ operations to be resumed.

INSQ table 40, which contains static parameters, may be provided to thestorage device (and, if desired, updated) by a remote device or computersystem, for example by using a dedicated Application ProgrammingInterface (“API”). A dedicated API may be used, for example, to updateor delete an existing table entry, or to add a new table entry, and soon. Briefly, “API” is a source code interface that can be provided by anoperating system, a library or a service to support requests made bycomputer programs. Alternatively, INSQ table 40 may be handled (i.e.,created and stored) at the time of manufacturing of the storage devices,or by a software developer at the storage device's customization stage.INSQ table 40 may be handled (i.e., created, stored, modified, andupdated) during runtime by an application that runs on the host device.The customization requirements may pertain to, or be derived from,applications running on the related host device, usage scenarios, systemfeatures, and so on.

FIG. 5 shows an INSQ table 50 according to an example embodiment of thepresent disclosure. INSQ table 50, which contains INSQs' dynamicparameters, includes four exemplary entries, numbered 1 through 4, eachof which accommodates one INSQ and INSQ-related parameters, as describedbelow. The parameters held in INSQ table 50 are dynamically collectedand updated by the storage device during runtime (i.e., “on-the-fly”),responsive to (i.e., derived from) commands issued by the host device tothe storage device with regard to the service rendered by the hostdevice. For example, if the host device is an MP3 player, the commandsthe MP3 player sends to the storage device can be associated withplaying back an audio file. Exemplary dynamic parameters are shown inFIG. 5, described below.

INSQ table 50 of FIG. 5 contains exemplary dynamic parameters, which arerelated to the four exemplary INSQs in INSQ table 40 of FIG. 4, and fourexemplary fields for holding these parameters, as follows:

-   -   (1) “INSQ's identifier” (shown at 501). This field accommodates        the types of INSQs or the names that have been assigned to the        INSQs. As mentioned above, INSQ table 50 relates to the four        exemplary INSQs of INSQ table 40. Therefore, INSQ table 50 uses        the same INSQs' types or names as table 40.    -   (2) “Status (On/Off)” (shown at 502). The value (i.e., “On” or        “Off”) stored in this field specifies whether an INSQ is in        progress or not. That is, if the INSQ is currently in progress,        the value assigned to it would be “On”, and if the INSQ is        currently not in progress, the value assigned to it would be        “Off”.    -   (3) “Dynamic BOS parameter” (shown at 503). If an INSQ is not in        progress (i.e., its status in the “Status (On/Off)” field is        “Off”), the storage device “waits” for (i.e., expects) the INSQ        to begin. Therefore, the storage device calculates or evaluates        the value that is to be held in the “Dynamic BOS parameter”        field, in order to decide whether a BOS indication has occurred.        The dynamic BOS parameters are calculated by the storage device        based on one or more commands that the storage device receives        from the host device.    -   (4) “Dynamic EOS parameter” (shown at 504). If an INSQ is in        progress (i.e., its status in the “Status (On/Off)” field is        “On”), the storage device “waits” for (i.e., expects) the INSQ        to terminate. Therefore, the storage device calculates the value        of the EOS parameter that is to be held in the “Dynamic EOS        parameter” field. The dynamic EOS parameters are calculated by        the storage device based on one or more commands that the        storage device receives from the host device.

Continuing Example 1 above, the current status INSQ called “Play MP3”,shown at 510, is “On” (shown at 515), meaning that the INSQ is inprogress. Therefore, the storage device does not have to calculate theBOS parameter, for which reason the value currently held in the “DynamicBOS parameter” field is “N/A” (i.e., Not Applicable). As explainedabove, if an INSQ is “On”, the storage device expects the INSQ toterminate. Therefore, the storage device evaluates, calculates, orchecks the dynamic EOS parameter in order to assess whether an EOS isoccurring or has occurred. If the storage device decides that an EOS isoccurring or has occurred, the storage device changes the status of the“Play MP3” INSQ from “On” to “Off”, and evaluates, calculates, or checksthe dynamic BOS parameter in order to assess whether a BOS is occurringor has occurred.

In other words, the dynamic BOS parameter pertaining to the “Play MP3”INSQ is not applicable (shown as “N/A” at 520) when the “Play MP3” INSQis currently active (i.e., it is “On” at 515), which means that thecurrent value of the dynamic EOS parameter has to be considered, which,in this example, is “12 milliseconds”. As the “Play MP3” INSQ proceeds,the value of this dynamic EOS parameter increases and when it reaches orexceeds the static EOS threshold value “Not streaming for at least 1second” (which is specified in INSQ table 40), the storage devicedecides that EOS has occurred. If the “Play MP3” INSQ was inactive(i.e., if it was “Off”), the parameter to be considered would have beenthe dynamic BOS parameter rather than the dynamic EOS parameter.

As shown in INSQ table 40 the EOS threshold for the “Play MP3” INSQ is“1 second” (shown at 425 in FIG. 4), which means that the average rate420 (the criteria being shown in FIG. 4) at which the MP3 player readsdata from the storage device has to continuously deviate from thestandard rate (i.e., 16 KB/s) for a duration of at least one second inorder for the storage device to decide that an EOS has occurred.However, as shown in FIG. 5, only 12 milliseconds (shown at 525 in FIG.5) have elapsed since the beginning of the current “Play MP3” INSQ.Therefore, the “Play MP3” INSQ is still considered by the storage deviceto be in the “On” state.

Continuing Example 2 above, the current status of the second INSQ called“Capture Multi-Shot Image” is “On”, meaning that the INSQ is inprogress. Therefore, the storage device does not have to calculate theBOS parameter, for which reason the value currently held in the “DynamicBOS parameter” field is “N/A” (i.e., Not Applicable). As explained aboveif an INSQ is “On”, the storage device expects the INSQ to terminateand, therefore, it evaluates, calculates, or checks the dynamic EOSparameter in order to assess whether an EOS is occurring. If the storagedevice decides that an EOS has occurred, the storage device changes thestatus of the “Capture Multishot Image” INSQ from “On” to “Off”, andevaluates, calculates, or checks the dynamic BOS parameter in order toassess whether a BOS has occurred.

In other words, the dynamic BOS parameter pertaining to the “CaptureMultishot Image” INSQ is not applicable because the “Capture MultishotImage” INSQ is currently active (i.e., it is “On”), which means that thecurrent value of the dynamic EOS parameter has to be considered, which,in this example, is “2.03 milliseconds”. As the “Capture MultishotImage” INSQ continues to proceed, the value of this dynamic EOSparameter increases and when it reaches or exceeds the static EOSthreshold value “Delay of over 3 milliseconds between bursts” (which isspecified in INSQ table 40), the storage device decides that EOS isoccurring or has occurred. If the “Capture Multishot Image” INSQ wasinactive (i.e., if it was “Off”), the parameter to be considered wouldhave been the dynamic BOS parameter rather than the dynamic EOSparameter.

As shown in INSQ table 40 the EOS threshold for the “Capture MultishotImage” INSQ is “Delay of over 3 milliseconds between bursts”, whichmeans that the delay between data writing bursts (the criteria beingshown in FIG. 4, in field 44) must exceed 3 milliseconds in order forthe storage device to decide that an EOS has occurred. However, as shownin FIG. 5, the maximum delay calculated or measured so far by thestorage device is only 2.03 milliseconds, for which reason the “CaptureMultishot Image” INSQ is still considered by the storage device to be inthe “On” state.

Continuing Example 3 above, the current status of the third INSQ called“Update Boot Image” INSQ is “Off”, meaning that the INSQ is inactive ornot in progress. Therefore, the storage device does not calculate thedynamic EOS parameter but, rather, it calculates, evaluates or checks,the dynamic BOS parameter in order to assess whether a BOS has occurred.If a BOS has occurred the storage device changes the status of the“Update Boot Image” INSQ from “Off” to “On” and evaluates, calculates,or checks the dynamic EOS parameter in order to assess whether an EOShas occurred.

As shown in INSQ table 40 the BOS threshold for the “Update Boot Image”INSQ is “Occurrence of the event” (the “event” referring to writing ofdata into sector #0), which means that data must be written into sector#0 in order for the storage device to decide that a BOS has occurred.However, as shown in FIG. 5, writing data into sector #0 has notoccurred yet (referred to as “Did not happen” in FIG. 5), for whichreason the “Update Boot Image” INSQ is still considered by the storagedevice to be in the “Off” state.

Continuing Example 4 above, the status of the fourth INSQ called “ReadBoot Image” INSQ is “Off”, meaning that the INSQ is inactive (i.e., theINSQ is not in progress). Therefore, the storage device does notcalculate the EOS parameters but, rather, it calculates or checks theBOS parameter and in order to assess whether a BOS has occurred. If aBOS has occurred, the storage device changes the status of the “ReadBoot Image” INSQ from “Off” to “On” and evaluates, calculates, or checksthe dynamic EOS parameter in order to assess whether an EOS hasoccurred.

As shown in INSQ table 40 the BOS threshold for the “Read Boot Image”INSQ is “Occurrence of the event” (the “event” referring to reading datafrom sector #0), which means that data must be read from sector #0 inorder for the storage device to decide that a BOS has occurred. However,as shown in FIG. 5, reading data from sector #0 has not occurred yet(referred to as “Did not happen” in FIG. 5), for which reason the “ReadBoot Image” INSQ is still considered by the storage device to be in the“Off” state.

FIG. 6 shows a method usable by a storage device for changing the statusof an INSQ from “Off” (i.e., from “INSQ is not in progress” state) to“On” (i.e., to “INSQ is in progress” state) according to an exampleembodiment of the present disclosure. A host device (e.g., an MP3player)may issue and forward one or more commands to a storage device, whichpertain to an INSQ. A command may be a data-reading request or adata-writing request. A data-reading request and a data-writing requestmay be related to, or associated with, an INSQ.

At step 50 a storage device receives a host device's command (e.g., aplay back command). Responsive to receiving the host device's commandthe storage device commences an INSQs check routine to check INSQspre-listed in its INSQ table, to see if any of the listed INSQs isrelated to, or affected by, the received command. That is, the storagedevice checks whether the received command has an effect on the currentstatus or state of any of the pre-listed INSQs. The INSQ table used bythe storage device may be structure-wise identical or similar to INSQtables 40 and 50 of FIGS. 4 and 5, respectively.

At step 52 the storage device starts checking (i.e., by using the INSQscheck routine) the INSQ table by checking the first table's entry, and,at step 54, the storage device checks whether the first entry of theINSQ table is “null”, where “null” indicates the end of the INSQ table.If the first entry is null (shown as “Y” at step 54), the process isaborted (shown as “Exit” at 66) because the INSQ table is empty, or theentire INSQs have already been checked by the storage device in respectof the received command.

If the first entry is not null (shown as “N” at step 54), this meansthat the entry contains an INSQ whose status is yet to be evaluated, orreevaluated, by the storage device based on the currently receivedcommand (or based on the currently received command and on one or morepreviously received commands) and the definitions and characteristics(e.g., conditions, thresholds, etc.) related to the currently evaluatedINSQ. That is, the storage device has to decide whether the state of theINSQ in question has to change because of the one or more commands thatthe storage device has received from the host device.

At step 56 the storage device checks whether the INSQ's current statusis “Off”. If the current status of the INSQ is “Off” (shown as “Y” atstep 56), this means that the INSQ is inactive (i.e., it is not inprogress) and, therefore, the storage device waits in anticipation for achange to occur in the INSQ's state; that is, from inactive state (i.e.,“INSQ not in progress”) to active state (i.e., “INSQ in progress”).

Accordingly, at step 58 the storage device measures, checks or estimatesthe BOS parameter and checks, at step 60, whether the currentlymeasured, checked or estimated BOS parameter exceeds the BOS thresholdspecified in the INSQ table. If the BOS parameter exceed the BOSthreshold (shown as “Y” at step 60), this indicates to the storagedevice that the status of the currently evaluated INSQ is changing, orhas recently changed, from “inactive” to “active” (i.e., the INSQ is nowin progress) and, therefore, the storage device does not execute any newESQ operation that is associated with that INSQ, or, if an ESQ operationis in progress when the INSQ changes states (i.e., from “inactive” to“active”), the storage device suspends that ESQ operation and resumesISQ operations that are related to the INSQ in question, as shown inFIG. 2. In addition, the storage device updates the INSQ table bychanging, at step 62, the status of the INSQ from “Off” to “On”.Thereafter, the storage device moves on, at step 64, to the next entry(i.e., the second entry so far) of the INSQ table, and the processdescribed in connection with the first entry of the INSQ table isrepeated for the second entry and for the remaining INSQs, until a nullentry is encountered at step 54, which terminates the INSQs evaluationprocess. The same INSQs evaluation process may be repeated for eachcommand that the storage device receives from the host device. If theBOS threshold is not exceeded (shown as “N” at step 60), this means thatthe INSQ in question is still inactive and, therefore, its current state(i.e., “Off”) should remain unchanged. Therefore, the storage devicedoes not change the INSQ state and evaluates the status of the nextINSQ.

FIG. 7 shows a method usable by a storage device for changing the statusof an INSQ from “On” (i.e., from “INSQ is in progress” state) to “Off”(i.e., to “INSQ is not in progress” state) according to an exampleembodiment of the present disclosure. A host device (e.g., an MP3player)may issue and forward one or more commands to a storage device, whichpertain to an INSQ. A command may be a data-reading request or adata-writing request. A data-reading request and a data-writing requestmay be related to, or associated with, an INSQ.

At step 70 a storage device receives a host device's command (e.g., aplay back command). Responsive to receiving the host device's commandthe storage device commences an INSQs check routine to check INSQspre-listed in its INSQ table, to see if any of the listed INSQs isrelated to, or affected by, the received command. That is, the storagedevice checks whether the received command has an effect on the currentstatus or state of any of the pre-listed INSQs. The INSQ table used bythe storage device may be structure-wise identical or similar to INSQtables 40 and 50 of FIGS. 4 and 5, respectively.

At step 72 the storage device starts checking (i.e., by using the INSQscheck routine) the INSQ table by checking the first table's entry, and,at step 74, the storage device checks whether the first entry of theINSQ table is “null”, where “null” indicates the end of the INSQ table.If the first entry is null (shown as “Y” at step 74), the process isaborted (shown as “Exit” at 86) because the INSQ table is empty, or theentire INSQs have already been checked by the storage device in respectof the received command.

If the first entry is not null (shown as “N” at step 74), this meansthat the entry contains an INSQ whose status is yet to be evaluated, orreevaluated, by the storage device based on the currently receivedcommand (or based on the currently received command and on one or morepreviously received commands) and the definitions and characteristics(e.g., conditions, thresholds, etc.) related to the currently evaluatedINSQ. That is, the storage device has to decide whether the state of theINSQ in question has to change because of the one or more commands thatthe storage device received from the host device.

At step 76 the storage device checks whether the INSQ's current statusis “On”. If the current status of the INSQ is “On” (shown as “Y” at step76), this means that the INSQ is active (i.e., it is in progress) and,therefore, the storage device waits in anticipation for a change tooccur in the INSQ's state; that is, from active state (i.e., “INSQ inprogress”) to inactive state (i.e., “INSQ is not in progress”).

Accordingly, at step 78 the storage device measures, checks or estimatesthe BOS parameter and checks, at step 80, whether the currentlymeasured, checked or estimated BOS parameter exceeds the BOS thresholdspecified in the INSQ table. If the BOS parameter exceed the BOSthreshold (shown as “Y” at step 80), this indicates to the storagedevice that the status of the currently evaluated INSQ is changing, orhas recently changed, from “active” to “inactive” (i.e., the INSQ is notin progress) and, therefore, the storage device the storage devicesuspends ISQ operations and resumes ESQ operations related to the INSQin question, as shown in FIG. 3, and, in addition, changes, at step 82,the status of the INSQ from “On” to “Off”.

In addition, the storage device updates the INSQ table by changing, atstep 82, the status of the INSQ from “On” to “Off”. Thereafter, thestorage device moves on, at step 84, to the next entry (i.e., the secondentry so far) of the INSQ table, and the process described in connectionwith the first entry of the INSQ table is repeated for the second entryand for the remaining INSQs, until a null entry is encountered at step74, which terminates the INSQs evaluation process. The same INSQsevaluation process is repeated for each command that the storage devicereceives from the host device.

If the EOS threshold is not exceeded (shown as “N” at step 80), thismeans that the INSQ in question is still active and, therefore, itscurrent state (i.e., “On”) should remain unchanged. Therefore, thestorage device does not change the INSQ state and evaluates the statusof the next INSQ.

FIG. 8 shows a storage device 800 according to an example embodiment ofthe present disclosure. Storage device 800 includes a mass storage area808, which may be a flash memory, a controller 840 that manages massstorage area 808 via data and control lines 806 and communicates withhost device 850 via host interface 802. Controller 840 controls all ofthe data storage and data retrieval to/from mass storage area 808 anddata transfer to/from host device 850 by controlling, for example,“read”, “write” and “erase” operations and by controlling communicationwith host device 850. Controller 840 also performs internal“housekeeping” operations such as wear leveling, etc. These activitiesof controller 840 are known in the art

A portion of mass storage area 808 may be used to hold a static INSQtable 810, a dynamic INSQ table 820, and an ISQ and ESQ table 830.Static INSQ table 810 may contain a list of predefined INSQs and staticINSQs' BOS and EOS parameters and threshold values related to thepredefined INSQs. Dynamic INSQ table 820 may contain an identical listof the predefined INSQs, or entries of INSQ table 820 may be associatedwith the INSQs held in INSQ table 810. Dynamic INSQ table 820 mayadditionally contain dynamic INSQs' BOS and EOS parameters and thresholdvalues related to the predefined INSQs.

ISQ and ESQ table 830 may contain multiple first sets of internaloperations (i.e., multiple sets of ESQ operations) and multiple secondsets of internal operations (i.e., multiple sets of ISQ operations) thatare respectively associated with, or related to, the predefined INSQs.That is, with each INSQ of the predefined INSQs are associated a firstset of operations and a second set of operations. Static INSQ table 810may be identical or similar to the INSQ table of FIG. 4, and dynamicINSQ table 820 may be identical or similar to the INSQ table of FIG. 5.Static INSQ table 810 and dynamic INSQ 820 may be regarded as one INSQtable and, in general, INSQ table 810, INSQ table 820 and ISQ and ESQtable 830 may be part of, or managed as, one relational database. Staticinformation, such as static parameters and threshold values should beheld in a non-volatile memory, whereas dynamic information, such asdynamic BOS related values, dynamic EOS related values and currentstatus of INSQs, can be held in a volatile memory such as a RandomAccess Memory (“RAM”) (or in a non-volatile memory).

Host device 850 sends storage commands to storage device 800 and, foreach of the commands that the storage device receives, controller 840searches in lookup tables 810 and 820 for an INSQ to which the commandbelongs, or with which the command can be associated. If controller 840finds such an INSQ in lookup INSQ tables 810 and 820, controller 840updates in dynamic INSQ table 820 the value of dynamic parameters thatbelong to that INSQ and, based on static threshold values that are heldin static INSQ table 810, determines at which state (i.e., “INSQ is inprogress” or “INSQ is not in progress”) the INSQ is in, or whether theINSQ has changed, or is about to change, its state. If controller 840determines that the INSQ has changed, or is about to change, its state,controller 840 looks in lookup table ISQ/ESQ table 830 whether there areISQ or ESQ operations associated with the INSQ that should be allowed tobe executed or resumed, or should be avoided or suspended, as the casemay be.

In other words, controller 840 is adapted to use one or more storagecommands, which are received from host device 850, to determine whetherany of the one or more of the predefined INSQs is transitioning, or hastransitioned, from the “inactive” state to the “active” state or fromthe “active” state to the “inactive state”, and, responsive to apredefined INSQ transitioning from the “inactive” state to the “active”state, controller 840 avoids or suspends execution of the ESQ operationspertaining to that INSQ and allows or performs execution of ISQoperations pertaining to the that INSQ.

Responsive to an INSQ transitioning from the “active” state to the“inactive” state controller 840 allows or resumes execution of the ESQoperations and avoids or suspends execution of the ISQ operations.Controller 840 determines transitions of an INSQ from “inactive” stateto “active” state and from “active” state to “inactive” state bydetermining whether one or more commands that are received from the hostdevice, and/or information derived from the one or more commands,satisfy predefined BOS conditions or EOS conditions, as describedherein, for example in connection with tables 40 and 50 of FIGS. 4 and5, respectively. Controller 840 determines whether the command(s) and/orthe information derived from the command(s) satisfy the predefined BOSconditions or the EOS conditions by comparing values, or accumulatedvalues, of dynamic variables/parameters to predefined static parameters(i.e., to preset conditions).

Controller 840 may use a counter such as counter 860 to count eventsrelating to, or events derived from, one or more commands that thestorage device receives from the host device. Controller 840 may have atimer such as timer 870 to perform various time-related calculations,for example, data read rate and data write rate.

FIG. 9 schematically illustrates using a database 900 by a controller ofa storage device according to an example embodiment of the presentdisclosure. Lookup table 905 contains an exemplary list of fourpredefined INSQs 910. Although not shown in FIG. 9, lookup table 905also contains parameters and thresholds of, or similar to, the type heldin lookup tables 810 and 820 of FIG. 8, which parameters and thresholdsare associated with exemplary INSQs 910. Lookup table 930, which may beidentical or similar to ISQ/ESQ table 830 of FIG. 8, contains anexemplary list of ISQ and ESQ operations that are associated withpredefined INSQs 910. For example, ISQs 901 and ESQ 911 are associatedwith INSQ 910 called “Capture Multishot Image”, ISQs 902 and ESQs 912may be associated with INSQ 910 called “Play MP3”, ISQs 903 and ESQs 913may be associated with INSQ 910 called “Update Boot Image”, and ISQs 904and ESQs 914 may be associated with INSQ 910 called “Read Boot Image”.

A storage command is issued and sent by a host device, such as hostdevice 850 of FIG. 8, and received at a storage device such as storagedevice 800 of FIG. 8, the storage command being symbolically shown at915 as an arrow. Responsive to receiving storage command 915 the storagedevice's controller checks whether storage command 915 belongs to, orcan be associated with, any one of INSQ 910. In the example shown inFIG. 9 the received storage command 915 is found to belong to, or can beassociated with, INSQ 910 called “Capture Multishot Image” (theassociation shown by dashed line 920).

As explained above in connection with table 50 of FIG. 5, the dynamicINSQ table holds the current status (i.e., “On” or “Off”) for eachpredefined INSQ, and, for a given INSQ, the storage device's controllerchecks the EOS parameter(s) and EOS threshold(s) if INSQ in question is“On”. Otherwise (i.e., the INSQ in question is “Off”), the storagedevice's controller checks the BOS parameter(s) and BOS threshold(s)associated with that INSQ. Referring again to FIG. 9, by updating thedynamic parameter(s) associated with the “Capture Multishot Image” INSQand scrutinizing the corresponding threshold value(s) the storagedevice's controller “knows” whether the “Capture Multishot Image” INSQis changing, or has changed, its state, from “On” to “Off” or from “Off”to “On”.

If the “Capture Multishot Image” INSQ is changing, or has changed, itsstate, from “On” to “Off”, this means that ISQ operations are to beavoided or suspended and ESQ operations are allowed to be executed ortheir execution should be resumed. If the “Capture Multishot Image” INSQis changing, or has changed, its state, from “Off” to “On”, this meansthat ISQ operations should be allowed or resumed or executed and ESQoperations must be avoided or suspended. Accordingly, the storage devicecontroller searches in ISQ/ESQ lookup table 930 for the ISQ and ESQoperations relevant to the INSQ “Capture Multishot Image”. As mentionedabove, ISQ operations 901 and ESQ 911 are associated with the “CaptureMultishot Image” INSQ, the associations being respectively shown asdashed lines 921 and 931. ISQ operations 901 include ISQ operationsdesignated as “ISQ-1”, “ISQ-2”, “ISQ-3”, “ISQ-4”, and “ISQ-5”. ISQoperation “ISQ-1” may be, for example, an operation, or a set ofoperations, involved, for example, in predicting and caching anticipateddata. ESQ operations 911 include ESQ operations designated as “ESQ-1”,“ESQ-2”, “ESQ-3”, “ESQ-4”, and “ESQ-5”. ESQ operation “ESQ-1” may be,for example, an operation, or a set of operations, involved, forexample, in static wear leveling. The type of the EOS and BOS parametersand their threshold values, and the type of ISQ and ESQ operations, areset or chosen for each predefined INSQ according to the type of theINSQ. The appropriate setting or choosing of these parameters, thresholdvalues, and types of operations are known in the art.

FIG. 10 shows a method usable by a storage device according to anexample embodiment of the present disclosure. At step 1010 one or moreintegral sequences of commands are defined, where each of the one ormore defined integral sequences of commands is capable of being in an“active” state and in an “inactive” state. At step 1020 a first set ofinternal operations (“ESQ”) and a second set of internal operations(“ISQ”) are defined for, and associated with, each of the one or moredefined integral sequences of commands, where a first set of internaloperations includes operations that are not to be executed while therespective integral sequence of commands is in the “active” state, and asecond set of internal operations includes operations that are permittedto be executed or are to be executed while the respective integralsequence of commands is in the “active” state.

At step 1030 the storage device receives a command from a host device,and at step 1040 it is determined, based on information derived from thereceived command, and possibly from previously received commands,whether any one of the one or more defined integral sequences ofcommands is in the “active” state, or is transitioning from the“inactive” state to the “active” state.

If the any one of the one or more defined integral sequences of commandsis in the “active” state, or is transitioning from the “inactive” stateto the “active” state (shown as “Y” at step 1040), then, at step 1050any operation of the first set of internal operations (i.e., ESQoperations) defined for, and associated with, that active integralsequence of commands is refrained from being executed, or its executionis suspended, and, at step 1060, operation or operations of the secondset of internal operations (i.e., ISQ operations) associated with thatactive integral sequence of commands is/are permitted to be executed ifexecution thereof has not yet started, or their execution is permittedto be continued if their execution was suspended. In some cases, it mayeven be highly recommended or desirable to execute certain operationsthat have some or a significant positive contribution to the efficiencyof the storage device or to the storage system as a whole.

However, if the any one of the one or more defined integral sequences ofcommands is not in the “active” state, or it is not transitioning fromthe “inactive” state to the “active” state (shown as “N” at step 1040);i.e., the integral sequence is in the inactive state, then, at step 1070any operation of the second set of internal operations (ISQ) definedfor, and associated with, the inactive integral sequence of commands isrefrained from being executed, and, at step 1080, operations of thefirst set of internal operations (ESQ) defined for, and associated with,that inactive integral sequence of commands are permitted to beexecuted. Regarding step 1040, determination whether a certain INSQ isactive or inactive is made after checking whether the current status ofthe INSQ is “On” (or it's status is transitioning from “Off” to “On”) or“Off” (or it's status is transitioning from “On” to “Off”), as describedin more detail in connection with FIGS. 6 and 7, respectively.

At least one of the one or more defined integral sequences of commandsmay be associated with playing back of multimedia content, or withcapturing multimedia content or images, or with data synchronization, orwith a boot command.

Each of the first set (ESQ) and second set (ISQ) of internal operationsdefined for, and associated with, an INSQ may include any of thefollowing operations: flash management operation; encryption/decryptionof outgoing/incoming data; compression/decompression ofoutgoing/incoming data; anti-virus operation; defragmentation operation;backing up data; and changing data format. A flash management operationmay involve: garbage collection; activating an error correctionmechanism; caching data into a fast flash storage area of the storagedevice; flushing cached data; using low power mode; and static wearleveling.

In one example “low-power mode” operations can be allowed while an INSQassociated with playing back a music file is in progress (i.e., active).That is, if an MP3player, an exemplary host device, plays back a musicfile, the storage device can use the “low power mode” while the storagedevice is receiving an INSQ (i.e., a series of commands) for playingback the music file. Because playing back a music file requires readingthe music file at a constant bit rate of, about, around or near 16KB/sec., the low-power mode operation(s) may be allowed only ifexecution thereof does not detrimentally affect the specified bit rate(i.e., 16 KB/sec.). An internal operation (ISQ) may be “allowed”,“recommended”, or “mandatory” with respect to a given INSQ. In thisexample “low power mode” operations are “allowed”, which means thatexecuting or refraining from executing these operations, while an“MP3play” INSQ is in progress, does not have much negative or positivecontribution on the overall performance of the storage system as awhole.

In one example the storage device can use an error correction mechanismto enhance data reading reliability while a host device is reading theoperating system's (“OS's”) bit image from the storage device. Readingthe OS image may be defined as an INSQ, and error correction operationsmay be defined for the OS image reading INSQ. In this example “OS imagereading” operations are “recommended” because, to the extent possible,it is recommended that actions to improve reliability of a data readingprocess be taken.

In one example the storage device can use data caching operations whilea digital camera, an exemplary host device, is storing multi-shotpictures in the storage device. Storing multi-shot pictures in thestorage device may be defined as an INSQ, and data caching operationsmay be defined for the multi-shot pictures storing INSQ. In this example“data caching” operations are “mandatory” because the rate at which thedigital camera transfers pictures to the storage device is higher thanthe speed at which the storage device can store the pictures.

Some operations are not recommended or should be avoided if an INSQ isin progress. In one example executing an anti-virus operation is notrecommended while an MP3player is playing back a music file becauseexecuting anti-virus operations under such circumstances might result inan audible hiccups-like interference. In one example executing a garbagecollection operation must be avoided while a digital camera is storingmulti-shot pictures in a storage device because executing garbagecollection operations under such circumstances might result in lost orcorrupted pictures.

It is noted that an internal operation can be permitted to be executed,or may be recommended or mandatory while some INSQs are in progress,whereas the same internal operation may have to be avoided or may be notrecommended while some other INSQs are in progress. Therefore, such aninternal operation may be simultaneously defined as an operation of afirst set of internal operations (ESQ) that are defined for one INSQ,and as an operation of a second set of internal operations (ISQ) thatare defined for another INSQ.

For example, execution of an error correction operation is recommendedfor an INSQ that involves updating an OS bit image, but it must beavoided in cases where an INSQ involves playing back a music file,because executing error correction operations consume a considerableelectrical power and computational resources.

In the description and claims of the present application, each of theverbs, “comprise”, “include” and “have”, and conjugates thereof, areused to indicate that the object or objects of the verb are notnecessarily a complete listing of members, components, elements, orparts of the subject or subjects of the verb. The articles “a” and “an”are used herein to refer to one or to more than one (i.e., to at leastone) of the grammatical object of the article, depending on the context.By way of example, depending on the context, “an element” can mean oneelement or more than one element. The term “including” is used herein tomean, and is used interchangeably with, the phrase “including but notlimited to”. The terms “or” and “and” are used herein to mean, and areused interchangeably with, the term “and/or,” unless context clearlyindicates otherwise. The term “such as” is used herein to mean, and isused interchangeably, with the phrase “such as but not limited to”.

Having thus described exemplary embodiments, it will be apparent tothose skilled in the art that modifications of the disclosed embodimentswill be within the scope of the invention. Alternative embodiments mayaccordingly include more modules, less modules, and/or functionallyequivalent modules. For example a storage device may use more, less,different, additional, or alternative criteria to decide whether EOS orBOS has occurred.

1. A method of handling internal operations of a storage device, themethod comprising: in response to information derived from one or morecommands received from a host device when the storage device is coupledto the host device, determining whether a sequence of commands is in oneof an active state and a first transition state, wherein in the firsttransition state the sequence of commands is transitioning from aninactive state to the active state; and while the sequence of commandsis in the active state or is in the first transition state, refrainingfrom executing any operation of a first set of internal memorymanagement operations, each of the first set of internal memorymanagement operations being an extra-sequence operation.
 2. The methodof claim 1, further comprising permitting execution of any operation ofa second set of internal memory management operations when the sequenceof commands is in the active state or in the first transition state,each of the second set of internal memory management operations being anintra-sequence operation.
 3. The method of claim 2, further comprisingwhen the sequence of commands is in the inactive state or in a secondtransition state, wherein in the second transition state the sequence ofcommands is transitioning from the active state to the inactive state,permitting execution of an operation of the first set of internal memorymanagement operations and refraining from executing any operation of thesecond set of internal memory management operations.
 4. The method ofclaim 1, further comprising determining whether the sequence of commandsis in the first transition state by determining whether the informationderived from the received one or more commands satisfies predefinedbeginning-of-sequence conditions.
 5. The method of claim 4, wherein thepredefined beginning-of-sequence conditions include a condition that anaverage read rate associated with reading moving picture experts groupaudio layer 3 (MP3) data by the host device matches a predetermined readrate.
 6. The method of claim 1, wherein the sequence of commands isassociated with playing back of moving picture experts group audio layer3 (MP3) content.
 7. The method of claim 1, wherein the sequence ofcommands is associated with data synchronization.
 8. The method of claim1, wherein the sequence of commands is associated with a boot command.9. The method of claim 1, wherein the first set of internal memorymanagement operations includes one of: a flash memory managementoperation; encryption/decryption of outgoing/incoming data;compression/decompression of outgoing/incoming data; an anti-virusoperation; a defragmentation operation; ruggedization; backing up data;changing data format; garbage collection; employing an error correctionmechanism; caching data into a fast flash storage area; flushing cacheddata; low power mode operation; and static wear leveling.
 10. The methodof claim 2, wherein the second set of internal memory managementoperations includes one of: a flash memory management operation;encryption/decryption of outgoing/incoming data;compression/decompression of outgoing/incoming data; an anti-virusoperation; a defragmentation operation; ruggedization; backing up data;changing data format; garbage collection; employing an error correctionmechanism; caching data into a fast flash storage area; flushing cacheddata; a low-power mode operation; and static wear leveling.
 11. Themethod of claim 1, wherein the received one or more commands includesone of a data-read request and a data-write request.
 12. A storagedevice comprising: a mass storage area to store: a sequence of commands,wherein the sequence of commands is in one of an active state, aninactive state, a first transition state wherein the sequence ofcommands is transitioning from the inactive state to the active state,and a second transition state wherein the sequence of commands istransitioning from the active state to the inactive state; a first setof internal memory management operations, each of the first set ofinternal memory management operations being an extra-sequence operation;and a second set of internal memory management operations, each of thesecond set of internal memory management operations being anintra-sequence operation; and a controller to: receive one or morecommands from a host device when the storage device is operationallycoupled to the host device; determine, based on information derived fromthe received one or more commands, when the integral sequence ofcommands is in the active state or in the first transition state; andresponsive to the integral sequence of commands being in the activestate or in the first transition state, prohibit execution of a firstoperation of the first set of internal memory management operations andenable execution of a second operation of the second set of internalmemory management operations.
 13. The storage device of claim 12,wherein the controller is further adapted to: determine when theintegral sequence of commands is in the inactive state or in the secondtransition state based on information derived from the received one ormore commands; and responsive to the integral sequence of commands beingin the inactive state or in the second transition state, permitexecution of an operation of the first set of internal memory managementoperations.
 14. The storage device of claim 12, wherein the controlleris further adapted to determine that the integral sequence of commandsis in the first transition state or in the second transition state bydetermining whether information derived from the received one or morecommands satisfies one of a predefined beginning-of-sequence conditionand a predefined end-of-sequence condition, respectively.
 15. Thestorage device of claim 14, wherein the predefined beginning-of-sequencecondition is that a predefined number of data bursts are received by thestorage device within a predefined period of time.
 16. The storagedevice of claim 14, wherein the controller is to determine whether theinformation derived from the received one or more commands satisfies aparticular predefined end-of-sequence condition that a time delaybetween reception by the storage device of two consecutive data burstsexceeds a predefined time period.
 17. The storage device of claim 14,wherein the controller is to determine whether the information derivedfrom the received one or more commands satisfies a particular predefinedbeginning-of-sequence condition by performing a comparison to apredefined beginning-of-sequence threshold stored in a parameter tablewithin the storage device.
 18. The storage device of claim 14, whereinthe controller is to determine whether the information derived from thereceived one or more commands satisfies a particular predefinedend-of-sequence condition by performing a comparison to a predefinedend-of-sequence threshold stored in a parameter table within the storagedevice.
 19. The storage device of claim 12, wherein the first operationof the first set of internal memory management operations is one of: aflash memory management operation; encryption/decryption ofoutgoing/incoming data; compression/decompression of outgoing/incomingdata; an anti-virus operation; a defragmentation operation;ruggedization; backing up data; changing data format; garbagecollection; employing an error correction mechanism; caching data into afast flash storage area; flushing cached data; using low power mode; andstatic wear leveling.
 20. The storage device of claim 12, wherein thesecond operation of the second set of internal memory managementoperations is one of: a flash memory management operation;encryption/decryption of outgoing/incoming data;compression/decompression of outgoing/incoming data; an anti-virusoperation; a defragmentation operation; ruggedization; backing up data;changing data format; garbage collection; employing an error correctionmechanism; caching data into a fast flash storage area; flushing cacheddata; using low power mode; and static wear leveling.